GetFilteredPlayer [C#]
[C#]
//Get encryption key private byte[] GetHashKey(string hashKey) { // Initialise UTF8Encoding encoder = new UTF8Encoding(); // Get the salt string salt = "fCycS3qSKsUlNz7wCb39XckN"; byte[] saltBytes = encoder.GetBytes(salt); // Setup the hasher Rfc2898DeriveBytes rfc = new Rfc2898DeriveBytes(hashKey, saltBytes); // Return the key return rfc.GetBytes(16); }
[C#]
//Encrypt data by AES private string Encrypt(byte[] key, string dataToEncrypt) { // Initialise AesManaged encryptor = new AesManaged(); // Set the key encryptor.Key = key; encryptor.IV = key; // create a memory stream using (MemoryStream encryptionStream = new MemoryStream()) { // Create the crypto stream using (CryptoStream encrypt = new CryptoStream(encryptionStream, encryptor.CreateEncryptor(), CryptoStreamMode.Write)) { // Encrypt byte[] utfD1 = UTF8Encoding.UTF8.GetBytes(dataToEncrypt); encrypt.Write(utfD1, 0, utfD1.Length); encrypt.FlushFinalBlock(); encrypt.Close(); // Return the encrypted data return Convert.ToBase64String(encryptionStream.ToArray()); } } }
[C#]
//Get list of filtered players for a specific manager that belongs to a specific company public ErrorType GetFilteredPlayer(out List<View_Player> listPlayer, string filter, long managerId, string sessionId) { //<param name=listPlayer>List of players retrieved for the company</param> //<param name=filter>Search query</param> //<param name=managerId>Manager Id retrieved at the user's connection</param> //<param name=sessionId>Session Id retrieved at the user's connection</param> //<returns>ErrorType indicates the status of the transaction</returns> return client.GetFilteredPlayer(out listPlayer, filter, managerId, sessionId); }